using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BlogExchange
{
    public partial class ErrorDialog : Form
    {
        public ErrorDialog(Exception exception)
        {
            InitializeComponent();
            ShowException(exception);
        }

        private void ShowException(Exception exception)
        {
            this.exceptionTraceTextBox.Text += exception.Message + Environment.NewLine;

            if (exception.InnerException != null)
            {
                ShowException(exception.InnerException);
            }
        }
    }
}